#hell0_makefile
ifneq ($(KERNELRELEASE),)
obj-m:=hello_nenopi_led.o
else
include ../../script/common.mk
# KERNELDIR:=/lib/modules/$(shell uname -r)/build
endif

PWD:=$(shell pwd)
TEST_FILE:=$(wildcard test_*.c)
TEST_FILE_BIN:=$(patsubst %.c,%.bin, ${TEST_FILE})

all:default 
default:ko test

ko:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

test:${TEST_FILE_BIN}

${TEST_FILE_BIN}:%.bin : %.c
	${CC} $^ -o $@

clean:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) clean
	rm -rf $(TEST_FILE_BIN)
